﻿<!DOCTYPE HTML>
<html>
<head>
    <title>Single:: w3layouts</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link href="css/style.css" rel="stylesheet" type="text/css" media="all"/>
    <link href="css/form.css" rel="stylesheet" type="text/css" media="all"/>
    <link href='http//fonts.googleapis.com/css?family=Exo+2' rel='stylesheet' type='text/css'>
    <script src="js/jquery1.min.js"></script>
    <!-- start menu -->
    <link href="css/megamenu.css" rel="stylesheet" type="text/css" media="all"/>
    <script type="text/javascript" src="js/megamenu.js"></script>
    <script src="js/jquery.cookie.js"></script>
    <script>$(document).ready(function () {
        $(".megamenu").megamenu();
        // 添加头
        $(".header").load("head.html");
        var bookId = $.cookie("bookId");

        $.ajax({
            url: "book/findBookById.do",
            type: "POST",
            data: {id: bookId},
            dataType: "json",
            cache: false,
            success: function (data) {
                var dataStr = "<div class=\"cont span_2_of_3\">\n" +
                    "                <div class=\"grid images_3_of_2\">\n" +
                    "                    <div id=\"container\">\n" +
                    "                        <div id=\"products_example\">\n" +
                    "                            <div id=\"products\">\n" +
                    "                                <div >\n" +
                    "                                    <img  style='height: 500px;' alt='我是一张图片' id=\"img1\" src=\"" + data.image + "\"/>\n" +
                    "                                </div>\n" +

                    "                            </div>\n" +
                    "                        </div>\n" +
                    "                    </div>\n" +
                    "                </div>\n" +
                    "                <div class=\"desc1 span_3_of_2\">\n" +
                    "                    <p class=\"m_5\">" + data.name + "</p>\n" +
                    "                    <span class=\"m_link\"><a href=\"#\"></a> </span>\n" +
                    "                    <p class=\"m_text2\" style='font-size: larger'>书籍简介:</p><p style='width:450px;font-size:medium'>" + data.besc + "</p><br>\n" +
                    "                </div>\n" +
                    "                    <div class=\"btn_form\">\n" +
                    "                            <a href='showBook.html' >返回列表菜单</a><br><br>\n" +
                    "                            <input type=\"button\" onclick='addBag(\"" + data.id + "\")' value=\"加入书包\" title=\"\">\n" +
                    "                    </div>\n" +
                    "                <div class=\"clear\"></div>\n" +
                    "\n" +
                    "            </div>";
                $("#textInfo").append(dataStr);
            }
        });

    });</script>
    <script type="text/javascript">
        function addBag(id) {
            var uid = null;
            /*获得session中的对象*/
            $.ajax({
                url: "user/getUser.do",
                type: "POST",
                data: {},
                dataType: "json",
                cache: false,
                success: function (data) {
                    if (confirm("是否将该书籍加入书包？")) {
                        if (data != null && (uid = data.id) != null) {
                            $.ajax({
                                url: "bag/addBookToBags.do",
                                type: "POST",
                                data: {
                                    bid: uid,
                                    bookId: id
                                },
                                dataType: "json",
                                cache: false,
                                success: function (data) {
                                    alert("添加成功");
                                    location.reload();
                                }
                            });
                        } else {
                            alert("请先登录");
                            window.location = "login.html";
                        }
                    }
                }
            });
        }
    </script>
    <script type="text/javascript" src="js/jquery.jscrollpane.min.js"></script>
    <script type="text/javascript" id="sourcecode">
        $(function () {
            $('.scroll-pane').jScrollPane();
        });
    </script>
    <!-- start details -->
    <script src="js/slides.min.jquery.js"></script>
    <script>
        $(function () {
            $('#products').slides({
                preload: true,
                preloadImage: 'img/loading.gif',
                effect: 'slide, fade',
                crossfade: true,
                slideSpeed: 350,
                fadeSpeed: 500,
                generateNextPrev: true,
                generatePagination: false
            });
        });
    </script>
    <!-- start zoom -->
    <link rel="stylesheet" href="css/zoome-min.css"/>
    <script type="text/javascript" src="js/zoome-e.js"></script>
    <script type="text/javascript">
        $(function () {
            $('#img1,#img2,#img3,#img4').zoome({showZoomState: true, magnifierSize: [250, 250]});
        });
    </script>
</head>
<body>
<div class="header"></div>


<div class="mens">
    <div class="main">
        <div class="wrap">
            <ul class="breadcrumb breadcrumb__t" id="textInfo"></ul>


            <div class="slider-wrapper theme-default">
                <div id="slider" class="nivoSlider">
                    <img src="images/t-img1.jpg" alt=""/>
                </div>
            </div>
            <div class="clear"></div>
        </div>
    </div>
    <div class="footer">
        <div class="footer-bottom">
            <div class="wrap">
                <div class="copy">
                    <p>Copyright &copy; 2014.Company name All rights reserved.<a target="_blank"
                                                                                 href="http//www.zjf88.com/">&#x7F51;&#x9875;&#x6A21;&#x677F;</a>
                    </p>
                </div>
                <div class="f-list2">
                    <ul>
                        <li class="active"><a href="about.html">关于我们</a></li>
                        |
                        <li><a href="delivery.html">服务条款</a></li>
                        |
                        <li><a href="contact.html">联系我们</a></li>
                    </ul>
                </div>
                <div class="clear"></div>
            </div>
        </div>
    </div>
    <div style="display:none">
        <script src='http//v7.cnzz.com/stat.php?id=155540&web_id=155540' language='JavaScript'
                charset='gb2312'></script>
    </div>
</body>
</html>